<?php
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this \yii\web\View */
/* @var $model \app\models\Comment */

?>
<?php foreach ($models as $model):?>
    <?php $isLike = $model->like; ?>
    <div class="comment-item">
        <a class="avator">
            <img src="<?= $model->user->getAvatar(); ?>"/>
        </a>
        <div class="con">
            <a id="<?= Url::to(['comment/like', 'id' => $model->id]); ?>" class="comment_like ico-zan J-zan<?= $isLike ? ' checked' : ''; ?>"><?= $model->likes; ?></a>
            <h4><?= $model->user->uname; ?></h4>
            <div class="txt"><?= Html::encode($model->content); ?></div>
            <div class="time"><?= \app\utils\BaseUtils::formatTime($model->ctime); ?></div>
        </div>
    </div>

<?php endforeach; ?>
